#define _CRT_SECURE_NO_WARNINGS 1
int cmp(int* a, int* b) {
    return *a - *b;
}
int arrayPairSum(int* nums, int numsSize) {
    qsort(nums, numsSize, sizeof(int), cmp);
    int sum = 0;
    for (int i = 0; i < numsSize; i += 2) {
        sum += nums[i];
    }
    return sum;
}